package com.zp.io;

import java.io.CharArrayReader;
import java.io.IOException;

public class CharArrayReaderTest {
	public static void main(String[] args) throws IOException {
		String str = "zhengpeng hello";
		
		char[] c = new char[str.length()];
		str.getChars(0,str.length(),c,0);
		
		CharArrayReader cr = new CharArrayReader(c);
		
		int i;
		while(-1 != (i = cr.read())){
			System.out.println((char)i);
		}
		cr.close();
	}
}
